#include "app_device.h"
#include "app_pool.h"
#include "app_mqtt.h"
#include "log.h"
#include <unistd.h>
#include "app_bt.h"
#include "app_serial.h"
int main(int argc, char const *argv[])
{   
    // 初始化mqtt 
   int ret= app_mqtt_init();
   if(ret==0)
   {
      log_info("mqtt init success");
   }

    // 初始化线程池
    ret= app_pool_init();
    if(ret==0)
    {
        log_info("pool init success");
    }

    // 初始化设备
    app_device_t *device= app_device_init();
 

    if(device!=NULL)
    {   
        app_serial_init(device);
        app_bt_init(device);
        log_info("device init success");
        app_device_start();
    }
    while(1)
    {
        sleep(1);
    }
    return 0;
}
